package cn.com.greatwall.flowable.service.dto;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

import lombok.Data;

/**
 * @Author herw
 * @Time 2020-11-16 11:18:33
 * @Version 1.0
 * @Description: TODO(用一句话描述该文件做什么)
 */
@Data
public class ModelDto implements Serializable {
    private String id;
    private String name;
    private String key;
    private String category;
    private Date createTime;
    private Date lastUpdateTime;
    private Integer version;
    private String metaInfo;
    private String tenantId;
    private String description;
    private String editor;
    private Boolean deployed;
    private Boolean newVersion;
    
    public String getMetaInfo() {
        ObjectMapper mapper = new ObjectMapper();
        ObjectNode node = mapper.createObjectNode();
        node.put("name", name);
        node.put("description", description);
        
        return node.toString();
    }
}
